package com.hcloud.libupload.http

import com.hcloud.libupload.comom.UploadLib
import okhttp3.Interceptor
import okhttp3.Response

class UploadHeadInterceptor : Interceptor {

    override fun intercept(chain: Interceptor.Chain): Response {
        val head=UploadLib.instance().uploadConfig.uploadHead
        val request = chain.request().newBuilder()
            .addHeader("from", "android")
            .addHeader("model", head.model)
            .addHeader("version", head.version)
            .addHeader("deviceCode", head.deviceCode)
            .addHeader("channel", head.channel)
            .addHeader("App-Type", head.app_type)
            .build()
        return chain.proceed(request)
    }
}